home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 2: CDPD 1
/
Almathera Ten on Ten - Disc 2: CDPD 1.iso
/
pd
/
051-075
/
071
/
amibas
/
lib2
(
.txt
)
< prev
next >
Wrap
AmigaBASIC Source Code
|
1995-03-13
|
2KB
|
70 lines
REM - This demo program shows how to
REM - call Amiga system routines from
REM - AmigaBasic.
REM - Difference to program Library:
REM - also disk resident fonts can
REM - be activated.
DECLARE FUNCTION AskSoftStyle& LIBRARY
DECLARE FUNCTION OpenDiskFont& LIBRARY
DECLARE FUNCTION Execute& LIBRARY
LIBRARY "graphics.library"
LIBRARY "diskfont.library"
enable%=AskSoftStyle&(WINDOW(8))
Font "topaz.font",8,0,0
FOR i=0 TO 4
SetStyle CINT(2^i)
NEXT i
PRINT :PRINT
Font "opal.font",12,0,0
enable%=AskSoftStyle&(WINDOW(8))
FOR i=0 TO 4
SetStyle CINT(2^i)
NEXT i
SetStyle 0
Font "topaz.font",8,0,0
Font "",0,0,0 ' closes last font
REM --- Next line only works, if
REM --- AmigaBasic was called from
REM --- CLI and not from Workbench.
' DosLibDemo
LIBRARY CLOSE
END
SUB Font(fontName$, height%, style%, prefs%) STATIC
SHARED pFont&
' Herewith every font (also form disk) useable.
IF pFont&<>0 THEN CALL CloseFont(pFont&)
fontName0$=fontName$+CHR$(0)
textAttr&(0)=SADD(fontName0$)
textAttr&(1)=height%*65536 + style%*256 + prefs%
pFont&=OpenDiskFont&(VARPTR(textAttr&(0)))
IF pFont& <> 0 THEN SetFont WINDOW(8),pFont&
END SUB
SUB SetStyle(mask%) STATIC
SHARED enable%
SetSoftStyle WINDOW(8),mask%,enable%
PRINT "SetSoftStyle(";mask%;")"
END SUB
SUB DosLibDemo STATIC
LIBRARY "dos.library"
' This activates the function Execute from dos.library.
x=Execute&(SADD("list >RAM:temp"+CHR$(0)), 0, 0)
OPEN "RAM:temp" FOR INPUT AS 1
WHILE NOT EOF(1)
LINE INPUT #1,a$
PRINT a$
WEND
CLOSE
KILL "RAM:temp"
END SUB